﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OnlineCooperation.DB;
using OnlineCooperation.Entity;

namespace OnlineCooperation
{
    public partial class HomePageJump : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"] == null || Session["UserID"].ToString() == "")
            {
                Response.Write("<script>alert('用户尚未登录！');window.location='Login.aspx';</script>");
            }
        }

        protected void Button_DeleteUser_Click(object sender, EventArgs e)
        {
            UserDB UDB = new UserDB();
            int userid = int.Parse(Session["UserID"].ToString());
            UDB.Delete(UDB.GetUserByID(userid));
            Response.Redirect("Index.aspx");
        }
    }
}